how to display all elements of an array in javascript